package com.imooc;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import tk.mybatis.spring.annotation.MapperScan;

import java.net.InetAddress;
@Slf4j
@Controller
@RequestMapping("/")
@Configuration
@SpringBootApplication
@MapperScan(basePackages = "com.imooc.mapper")
// 扫描mybatis mapper包路径
// 扫描 所有需要的包, 包含一些自用的工具类包 所在的路径
public class Application {


	@Bean
	public SpringUtil getSpingUtil() {
		return new SpringUtil();
	}
	
	public static void main(String[] args) {

		SpringApplication.run(Application.class, args);
		try {
			log.info("启动成功：" + "http://" + InetAddress.getLocalHost().getHostAddress() + ":7000/index" );
		}catch (Exception e){}

	}
}
